package com.cuit.controller;

import com.cuit.service.LogoutService;
import com.cuit.utils.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SYE
 * @date 2023/7/27 14:09
 * @desciption: 退出登录controller
 */
@RestController
@RequestMapping("/api")
@ApiOperation(value = "退出登录")
public class LogoutController {

    @Autowired
    private LogoutService logoutService;


    @PostMapping("/logout")
    @ApiOperation(value = "退出登录")
    public Result logout(@RequestHeader("Authorization") String token){
        return logoutService.logout(token);
    }
}
